<?php


/**
 * @author Admin
 *
 *
 */
class ViewGallery extends Gallery {
	//TODO - Insert your code here
	/**
	 * 
	 * Spits the images in the requested gallery into the $dir_assets array
	 */
	protected function initGallery(){
		$displaying = $this->imgs_per_page;
		$cur = $this->uri->segment(6, 0);
		$this->load->model('GalleryModel','gmodel');
		$query = $this->gmodel->getCategory($this->startingCat);
		$cat_num = $this->gmodel->countCategory();
		$this->display->gallery_title = $query->name;
		$categoryID = $query->id;
				$config = array(
				"maxwidth" => $this->maxwidth,
				"editpath" => $this->editpath,
				"category_id" => $categoryID,
				"img_per_page" => $this->imgs_per_page
			);
		$config = array_merge( $config,$this->extraConfig  );
		$query = $this->gmodel->getImagesFromIds(explode(",",$config["selectedIds"]));
		// got category
		$imgs = array();
		$ci = & get_instance();
		$config = array(
				"maxwidth" => $this->maxwidth,
				"img_per_page" => $this->imgs_per_page
			);
 		$view = new DisplayGalleryView($this->display, $query,$ci );
 		$view->render( $config ); 
	}
}


?>